set(GB.BUILD 32 CACHE STRING "Fourth component of Windows VERSIONINFO resource FILEVERSION and PRODUCTVERSION parameters.")
set(GB.PACKAGE_RELEASE "" CACHE STRING "String to append to VERSION tuple.") # .e.g. "-beta20190413"
set(GB.SHA $ENV{GITHUB_SHA})
+if(DEFINED ENV{GITHUB_SHA})
+ find_program(GIT_EXECUTABLE NAMES git)
+ if(NOT GIT_EXECUTABLE STREQUAL "GIT-NOTFOUND")
+ execute_process(COMMAND ${GIT_EXECUTABLE} show -s --format=%aI
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ OUTPUT_VARIABLE GB.DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
+ endif()
+endif()
string(TIMESTAMP GB.COPYRIGHT_YEAR "%Y" UTC)
# may be overridden on cmake command line
#else
#define VERSION "@GB.MAJOR@.@GB.MINOR@.@GB.MICRO@@GB.PACKAGE_RELEASE@"
constexpr char kVersionSHA[] = "@GB.SHA@";
+constexpr char kVersionDate[] = "@GB.DATE@";
#define WEB_DOC_DIR "https://www.gpsbabel.org/htmldoc-@DOCVERSION@"
#endif
AboutDlg::AboutDlg(QWidget* parent, const QString& ver1,
const QString& ver2, const QString& ver3,
+ const QString& date,
const QString& installationId): QDialog(parent)
{
ui_.setupUi(this);
} else {
tt.replace("$hash$", "Hash: " + ver3);
}
+ if (date.isEmpty()) {
+ tt.replace("$date$", "");
+ } else {
+ tt.replace("$date$", "Date: " + date);
+ }
tt.replace("$installationId$", installationId);
// Not localized as it should never be seen.
public:
AboutDlg(QWidget* parent, const QString& ver1,
const QString& ver2, const QString& ver3,
+ const QString& date,
const QString& installationId);
private:
<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(Using backend $babelversion$)</p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">$hash$</p>
+<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">$date$</p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">$upgradetestmode$</p>
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Installation ID: $installationId$</p>
<p align="center" style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p>
//------------------------------------------------------------------------
void MainWindow::aboutActionX()
{
- AboutDlg aboutDlg(nullptr, babelVersion_, QString(appName) + QString(" " VERSION), kVersionSHA, babelData_.installationUuid_);
+ QDateTime date = QDateTime::fromString(kVersionDate, Qt::ISODate);
+ QString utcdate;
+ if (date.isValid()) {
+ utcdate = date.toUTC().toString(Qt::ISODate);
+ }
+ AboutDlg aboutDlg(nullptr, babelVersion_, QString(appName) + QString(" " VERSION), kVersionSHA, utcdate, babelData_.installationUuid_);
aboutDlg.setWindowTitle(tr("About %1").arg(appName));
aboutDlg.exec();
}
if(sizeof(kVersionSHA) > 1) {
warning(MYNAME ": Repository SHA: %s\n", kVersionSHA);
}
+ if(sizeof(kVersionDate) > 1) {
+ QDateTime date = QDateTime::fromString(kVersionDate, Qt::ISODate);
+ if (date.isValid()) {
+ warning(MYNAME ": Date: %s\n", qPrintable(date.toUTC().toString(Qt::ISODate)));
+ }
+ }
warning(MYNAME ": Compiled with Qt %s for architecture %s\n",
QT_VERSION_STR,
qPrintable(QSysInfo::buildAbi()));